package com.baichang.taoshunda.service;

import com.baichang.framework.excelption.ServiceException;

import java.util.List;
import java.util.Map;

/**
 * Created by ${wushenglu} on 2018/4/26.
 */

public interface RedPacketService {
    /**
     * 商家发布红包
     *
     * @param busId
     * @param number
     * @param money
     * @param content
     * @param payType
     * @param cityId
     * @return
     */
    Map addRedPacket(Integer busId, Integer number, double money, String content, Integer payType, Integer cityId);

    /**
     * @param busId
     * @return
     */
    boolean updateRedPacketStatus(Integer busId);

    /**
     * 查询所有的红包
     *
     * @param nowPage
     * @param pageSize
     * @param userId
     * @param cityId
     * @return
     */
    List<Map<String, Object>> findRedPacketList(Integer nowPage, Integer pageSize, Integer userId, Integer cityId);

    /**
     * 抢红包
     *
     * @param userId
     * @param redPacketId
     * @param trendsUserId
     * @return
     */
    Map<String, Object> grabRedPacket(Integer userId, Integer redPacketId, String trendsUserId) throws ServiceException;

    /**
     * 查看用户抢红包的记录
     *
     * @param userId
     * @param nowPage
     * @param pageSize @return
     */
    List<Map<String, Object>> findHistoryByUserId(Integer userId, Integer nowPage, Integer pageSize);

    /**
     * 查看用户红包个数、手气最佳个数、总计金额、当前金额
     *
     * @param userId
     * @return
     */
    Map<String, Object> getRedPacketByUserId(Integer userId) throws ServiceException;

    /**
     * @param redPacketId
     * @param userId
     * @return
     */
    Map<String, Object> getRedPacketById(Integer redPacketId, Integer userId) throws ServiceException;

    /**
     * 查询红包记录
     *
     * @param companyId
     * @param nowPage
     * @param pageSize
     * @return
     */
    List<Map<String, Object>> findRedPacketHistory(Integer companyId, Integer nowPage, Integer pageSize);
}
